//
//  YYEWithDrawTableViewCell.m
//  YuYingEDU
//
//  Created by 胡波 on 2018/1/8.
//  Copyright © 2018年 胡波. All rights reserved.
//

#import "YYEWithDrawTableViewCell.h"

@implementation YYEWithDrawTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.nameLabel = [[UILabel alloc]init];
        self.nameLabel.textColor = [UIColor blackColor];
        self.nameLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:self.nameLabel];
        
        self.indiLabel = [[UILabel alloc]init];
        self.indiLabel.textColor = [UIColor blackColor];
        self.indiLabel.text = @"￥";
        self.indiLabel.font = [UIFont systemFontOfSize:34];
        [self.contentView addSubview:self.indiLabel];
        
        self.moneyTF = [[UITextField alloc]init];
        self.moneyTF.textAlignment = NSTextAlignmentRight;
        [self.contentView addSubview:self.moneyTF];
        self.moneyTF.keyboardType = UIKeyboardTypeDecimalPad;

        
        self.lineView = [[UIView alloc]init];
        self.lineView.backgroundColor = [UIColor colorWithRed:248.0/255 green:226.0/255 blue:73.0/255 alpha:1];
        [self.contentView addSubview:self.lineView];
        
        self.balanceLabel = [[UILabel alloc]init];
        self.balanceLabel.textColor = [UIColor blackColor];
        self.balanceLabel.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:self.balanceLabel];
        
        self.allBtn = [[UIButton alloc]init];
        [self.allBtn setTitle:@"全部提现" forState:UIControlStateNormal];
        [self.allBtn setTitleColor:[UIColor colorWithRed:74.0/255 green:144.0/255 blue:226.0/255 alpha:1] forState:UIControlStateNormal];
        self.allBtn.titleLabel.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:self.allBtn];
        
        self.nameLabel.text = @"提现金额";
        self.balanceLabel.text = @"可用余额 999.00";
        
    }
    return self;
    
}



- (void)layoutSubviews {
    [super layoutSubviews];
    
    [self.nameLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.left).offset(18);
        make.top.equalTo(self.contentView.top).offset(12);
        make.height.equalTo(20);
    }];
    
    [self.indiLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.left).offset(22);
        make.top.equalTo(self.nameLabel.bottom).offset(17);
        make.height.equalTo(48);
    }];
    
    [self.moneyTF makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.left).offset(60.);
        make.right.equalTo(self.contentView.right).offset(-20);
        make.centerY.equalTo(self.indiLabel.centerY);
        make.height.equalTo(48);
    }];
    
    [self.lineView makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.left);
        make.right.equalTo(self.contentView.right);
        make.height.equalTo(0.5);
        make.top.equalTo(self.indiLabel.bottom).offset(11);
    }];
    
    [self.balanceLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.left).offset(10);
        make.bottom.equalTo(self.contentView.bottom).offset(-5);
    }];
    
    [self.allBtn makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView.right).offset(-10);
        make.bottom.equalTo(self.contentView.bottom).offset(-5);
        make.height.equalTo(20);
    }];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
